<!DOCTYPE html>
<html>
<head>
	<base href="${base_path}/">
    <meta charset="utf-8">
    <title>shiro 验证</title>
</head>
<body>

<% if(so.isAuthenticated()){ %>
您已经登录.  <a href="logout">退出</a>
<% }else{ %>
<a href="login">请登录</a>
<% } %>
<br>
<br>
<br>

<% if(so.hasRole("admin")){ %>
role:admin.
<br>
<% if(so.hasPermission("addUser")){%> <a href="#">添加</a> <% } %><br>
<% if(so.hasPermission("deleteUser")){%> <a href="#">删除</a> <% } %><br>
<% if(so.hasPermission("editUser")){%> <a href="#">编辑</a> <% } %><br>
<% if(so.hasPermission("showUser")){%> <a href="#">查询</a> <% } %><br>
<% } %>

<br>
<% if(so.hasRole("user")) { %>
role: user.
<br>
<% if(so.hasPermission("addUser")){%> <a href="#">添加</a> <% } %><br>
<% if(so.hasPermission("deleteUser")){%> <a href="#">删除</a> <% } %><br>
<% if(so.hasPermission("editUser")){%> <a href="#">编辑</a> <% } %><br>
<% if(so.hasPermission("showUser")){%> <a href="#">查询</a> <% } %><br>
<% } %>
<br>
has user and admin roles: <a href="userAdmin">check</a><br>
has user or admin role: <a href="userOradmin">check</a><br>
has admin role: <a href="admin">check</a><br>
has user role: <a href="user">check</a><br>
<br>
has addUser Permission <a href="addUser">check</a><br>

Admin: addUser showUser editUser deleteUser<br>
User: showUser

<br>
<br>

</body>
</html>